<?php
/**
 * Created by PhpStorm.
 * User: lgy
 * Date: 2018/6/30
 * Time: 10:31
 */

namespace app\admin\controller;
use think\Request;
use think\View;
use app\admin\model\Work AS WorkModel;
class Work
{
	//展示全部事务
	public function allWork(){
		$view = new View();
		return $view->fetch('work/all_work');
	}
	//获取全部事务
	public function getAllWork(){
		$request = Request::instance();
		$params = $request->param();
		$result = WorkModel::getAllWork($params);
		return json($result);
	}
	//添加事务
	public function addWork(){
		$request = Request::instance();
		$params = $request->param();
		$result = WorkModel::addWork($params);
		if($result){
			return adminRes('1','添加成功');
		}else{
			return adminRes('0','添加成功，请重试');
		}
	}
}